package com.gientech.test;

import com.gientech.spring.factory.CofferFactory;
import com.gientech.spring.model.Coffee;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringBeanForFactory {
    @Test
    public void Test() throws Exception {

        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("classpath:spring-beans.xml");
        Coffee c = (Coffee) ctx.getBean("cFactory");
        System.out.println("Xml Factory loader Coffee bean = " + c);
    }
}
